﻿@using Hiwjcn.Core.Domain.Auth;
@{ 
    this.SetLayout("AuthManageLayout");
    this.SetTitle("作用域");
}

<div class="row">
    <div class="col-md-12">
        <div class="pull-right">
            <div class="box_con">
                <a href="/AuthManage/EditScope/new" class="btn btn-info btn-sm" target="_self">新建</a>
            </div>
        </div>
    </div>
</div>

<div class="panel panel-default">
    <div class="panel-heading">Scope</div>
    <div class="panel-body">
        @{ 
            var list = this.GetNotNullViewData<List<AuthScope>>("list");
            if (ValidateHelper.IsPlumpList(list))
            {
                <table class="table table-striped table-hover">
                    <thead>
                        <tr>
                            <td>名称</td>
                            <td>展示名称</td>
                            <td>描述</td>
                            <td></td>
                            <td>修改时间</td>
                            <td></td>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (var m in list)
                        {
                            <tr>
                                <td>@(m.Name)</td>
                                <td>@(m.DisplayName)</td>
                                <td>@(m.Description)</td>
                                <td>
                                    @if (m.Important > 0)
                                    {
                                        <span class="label label-danger">重要</span>
                                    }
                                </td>
                                <td>@(m.UpdateTime.GetSimpleFriendlyDateTime())</td>
                                <td>
                                    <a href="/AuthManage/EditScope/@(m.UID)" class="btn btn-link btn-sm" target="_self">编辑</a>
                                </td>
                            </tr>
                        }
                    </tbody>
                    <tfoot>
                        <tr>
                            <td colspan="5" class="right">
                                @(Html.Raw(ViewData["pager"]))
                            </td>
                        </tr>
                    </tfoot>
                </table>
            }
            else
            {
                <div class="alert alert-info">没有定义scope</div>
            }
        }
    </div>
</div>